#ifndef __KEY_H__
#define __KEY_H__

#include "driver/gpio.h"

#define NUM_OF_KEY       3

#define KEY_DOWN_TIME_2S_THRESHOLD 2000    //长按2S
#define KEY_DOWN_TIME_4S_THRESHOLD 4000    //长按4S

#define SET   0   
#define SHIFT   1  
#define UP   2  

typedef enum {
    KEY_RELEASE,
    SET_KET_PRESS,
    SET_KEY_LONG_PRESS_2S,
    SET_KEY_LONG_PRESS_4S,
    SHIFT_KEY_PRESS,
    SHIFT_KEY_LONG_PRESS_2S,
    SHIFT_KEY_LONG_PRESS_4S,
    INC_KEY_PRESS,
    INC_KEY_LONG_PRESS_2S,
    INC_KEY_LONG_PRESS_4S,
    KEY_STATE_ALL
}KEY_STATE_Typedef;

typedef enum {
    SET_KEY,           //0    
    SET_LONG_2S_KEY,   //1 
    SET_LONG_4S_KEY,   //2 

    SHIFT_KEY,         //3 
    SHIFT_LONG_2S_KEY, //4 
    SHIFT_LONG_4S_KEY, //5

    INC_KEY,           //6 
    INC_LONG_2S_KEY,   //7
    INC_LONG_4S_KEY,   //8
    ALL_KEY            //9
}KEY_NAME_Typedef;  //其实就是键码

typedef enum   //用来区分是
{
    KEY_RELEASE_FLAG,
    KEY_DOWN_2S_FLAG,
    KEY_DOWN_4S_FLAG,
    KEY_ALL,
}KEY_DOWN_TIME_FLAG_Typedef;  



KEY_STATE_Typedef GetCurrentKeyState(void);
void Key_Driver_Task(void *param);

#endif